<template>
  <div>
      <el-form size="mini" label-position="left" label-width="80px">
          <el-form-item v-for="(item,key) in view_form" :key="key" :label="item.name">
              <el-input type="text" :placeholder="'请输入'+item.name" v-if="item.type=='text'"></el-input>
              <el-input type="number" :placeholder="'请输入'+item.name" v-if="item.type=='number'"></el-input>
              <el-input type="textarea" :placeholder="'请输入'+item.name" v-if="item.type=='textarea'" ></el-input>
              <template v-if="item.type=='radio'">
                  <el-radio-group v-model="item.limit">
                    <el-radio v-if="keys > 0" v-for="(items,keys) in item.data" :label="items.value">{{items.value == 1 ? '男' : '女'}}</el-radio>
                 </el-radio-group>
              </template>
              <el-select v-model="item.limit" v-if="item.type=='select'">
                  <el-option v-for="items in item.data" :value="items.value" :label="items.label"></el-option>
              </el-select>
              <template  v-if="item.type=='date'">
                  <el-date-picker type="datetime" placeholder="选择日期"></el-date-picker>
              </template>
              <div class="form-view-img-box" v-if="item.type=='image'">
                  <i class="el-icon-picture-outline"></i>
              </div>
          </el-form-item>
      </el-form>
  </div>
</template>

<script>
export default {
    props:{ view_form : {} },
    mounted(){
    }
}
</script>

<style>
.form-view-img-box{
    width: 80px;
    height: 80px;
    border:1px solid #e1e1e1;
    border-radius: 3px;
    text-align: center;
    line-height: 80px;
    font-size: 30px;
    color: #e1e1e1;
}
</style>